package ningbo.Test;

/**
 * @Author 宁铂
 * @Date 2021/7/14 19:28
 * @Version 1.0
 */
public class TestExtends {
    public static void main(String[] args) {
        /** 测试重象是重构 */
        Demo1 demo1 = new Demo1();
        Demo2 demo2 = new Demo2();

        demo1.e();
        demo2.e();

    }
}

abstract class Demo{
    int a;
    String b;

    public abstract void e();

    public abstract void f();
}

class Demo1 extends Demo{

    @Override
    public void e() {
        System.out.println("G");
    }

    @Override
    public void f() {
        System.out.println("H");
    }
}

class Demo2 extends Demo{

    @Override
    public void e(){
        System.out.println("E");
    }

    @Override
    public void f(){
        System.out.println("F");
    }
}